package com.kmxd.ams.controller.common;

import com.kmxd.ams.client.common.IIdSvc;
import com.kmxd.ams.core.common.enums.LogLevelEnum;
import com.kmxd.ams.core.common.enums.LogTypeEnum;
import com.kmxd.ams.core.log.annotation.AutoLog;
import com.kmxd.ams.core.result.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * id生成api
 *
 * @author nickbi
 * @since 2022-08-02
 */
@Slf4j
@RestController
@Tag(name = "id接口")
@RequestMapping("/common/id")
@AllArgsConstructor
public class IdCtl {

  private IIdSvc idSvc;

  /** 分页查询 */
  @Operation(summary = "档案相关id生成")
  @GetMapping("/arrange")
  @AutoLog(module = "id服务", type = LogTypeEnum.SYSTEM, level = LogLevelEnum.LOW, title = "档案相关id生成")
  public R<String> arrange() {
    return R.success(idSvc.arrange());
  }
}
